import 'package:flutter/material.dart';
import 'package:note_life/theme.dart';
import 'package:note_life/color.dart';

class ImgCheckPage extends StatefulWidget {
  String imgPath;
  String heroTag = "";
  ImgCheckPage({@required this.imgPath,this.heroTag});

  @override
  createState() => _ImgCheckPageState(imgPath: imgPath,heroTag: heroTag);
}

class _ImgCheckPageState extends State<ImgCheckPage> {
  String imgPath;
  String heroTag = "";
  _ImgCheckPageState({@required this.imgPath,this.heroTag});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body:
        NestedScrollView(
            headerSliverBuilder: (BuildContext context, bool inner) {
              return [
                SliverOverlapAbsorber(
                  handle:
                      NestedScrollView.sliverOverlapAbsorberHandleFor(context),
                  child:SliverAppBar(
//                    leading: GestureDetector(child: Icon(Icons.arrow_back),onTap: (){Navigator.pop(context);},) ,
                    floating: false,
                    pinned: true,
                    expandedHeight: 200.0,
                    flexibleSpace: FlexibleSpaceBar(
                      title: Text(
                        "测试",
                        style: TextStyle(color: AppColor.THEME_COLOR),
                      ),
                      background:Hero(tag: heroTag, child:  Image.network(
                        imgPath,
                        fit: BoxFit.cover,
                      )) ,
                    ),
                  ),
                ),
              ];
            },
            body: Container())
    );
  }
}
